package com.yaodian100.ec.order.entity;

import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import com.yaodian100.core.common.entity.BaseEntity;

@Entity
@Table(name = "EC_SERVICE_ORDER_DETAIL")
public class ServiceOrderDetail extends BaseEntity {

	/**
	 *   
	 * 
	 */
	private static final long serialVersionUID = 322605749533649805L;

	/**
	 * 主鍵值
	 */
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO, generator = "seq_ec_service_orderdetail")
	@SequenceGenerator(name = "seq_ec_service_orderdetail", sequenceName = "seq_ec_service_orderdetail")
	@Column(name = "service_detail_id")
	private Long serviceDetailId;

	@Column(name = "order_detail_id", nullable = false)
	private Long orderDetailId;

	/**
	 * 商品主鍵值
	 */
	@Column(name = "service_prod_id", nullable = false)
	private Long serviceProdId;

	/**
	 * 服務單號
	 */
	@Column(name = "service_id", length = 14)
	private String serviceId;

	/**
	 * 商品序號
	 */
	@Column(name = "prod_seq", nullable = false)
	private int prodSeq;

	/**
	 * 明細序號
	 */
	@Column(name = "detail_seq", nullable = false)
	private int detailSeq;

	/**
	 * 原始明細序號
	 */
	@Column(name = "org_detail_seq", nullable = false)
	private int orgDetailSeq;

	/**
	 * 原始規格序號
	 */
	@Column(name = "org_prod_spec_id", length = 10, nullable = false)
	private String orgProdSpecId;

	/**
	 * 原始規格名稱
	 */
	@Column(name = "org_prod_spec_name", length = 100, nullable = false)
	private String orgProdSpecName;

	/**
	 * 商品編號
	 */
	@Column(name = "prod_id", length = 10, nullable = false)
	private String prodId;

	/**
	 * 新規格序號
	 */
	@Column(name = "prod_spec_id", length = 10, nullable = false)
	private String prodSpecId;

	/**
	 * 商品名稱
	 */
	@Column(name = "prod_name", length = 500, nullable = false)
	private String prodName;

	/**
	 * 新規格名稱
	 */
	@Column(name = "prod_spec_name", length = 300, nullable = false)
	private String prodSpecName;

	/**
	 * 明細類別
	 */
	@Column(name = "detail_tp", length = 5, nullable = false)
	private String detailTp;

	/**
	 * 前台成本
	 */
	@Column(name = "ec_cost", nullable = false, columnDefinition = "numeric(10,2)")
	private BigDecimal ecCost;

	/**
	 * 后台成本
	 */
	@Column(name = "erp_cost", nullable = false, columnDefinition = "numeric(10,2)")
	private BigDecimal erpCost;

	/**
	 * 數量
	 */
	@Column(name = "qty", nullable = false)
	private int qty;

	/**
	 * 供應商
	 */
	@Column(name = "vend_id", length = 15, nullable = false)
	private String vendId;
	/**
	 * 订单编号
	 */
	@Column(name = "order_id", length = 13, nullable = false)
	private String orderId;
	/**
	 * 单价
	 */
	@Column(name = "UNIT_PRICE")
	private BigDecimal unitPrice;
	/**
	 * 实际退款
	 */
	@Column(name = "REAL_RETURN_PRICE")
	private BigDecimal realReturnPrice;
	/**
	 * 最高可退款
	 */
	@Column(name = "RETURN_PRICE")
	private BigDecimal returnPrice;
	/**
	 * 是否为加价购主商品
	 */
	@Column(name = "IS_ADDON_MASTER")
	private Boolean isAddOnMaster;

	/**
	 * 出貨單號
	 */
	@Column(name = "SHIPPING_OID")
	private String shippingOid;

	/**
	 * 出貨單細項 oid
	 */
	@Column(name = "SHIPPING_LINE_OID")
	private Long shippingLineOid;

	/**
	 * 原出貨單號
	 */
	@Column(name = "ORG_SHIPPING_OID")
	private String orgShippingOid;

	/**
	 * 原出貨單細項 oid
	 */
	@Column(name = "ORG_SHIPPING_LINE_OID")
	private Long orgShippingLineOid;

	/**
	 * 是否允许COD,default Y
	 */
	// @Transient
	@Column(name = "CAN_USE_COD", length = 1)
	private String canUseCod;

	/**
	 * 记录该商品之单一商品体积
	 */
	@Column(name = "UNIT_VOLUME_WEIGHT", columnDefinition = "NUMERIC(10, 2)")
	private BigDecimal unitVolumeWeight = BigDecimal.ZERO;

	/**
	 * 退换货条件
	 */
	@Column(name = "RETURN_RULE", length = 5)
	private String returnRule = "07_15";

	/**
	 * 记录该商品礼品卡使用比例(扣除运费，前几笔商品采用小数点第一位后无条件舍去的方式计算，最后一笔商品用减的)
	 */
	@Column(name = "GIFTCARD_BALANCE", columnDefinition = "NUMERIC(10, 2)")
	private BigDecimal giftcardBalance = BigDecimal.ZERO;

	/**
	 * @return the unitPrice
	 */
	public BigDecimal getUnitPrice() {
		return unitPrice;
	}

	/**
	 * @param unitPrice the unitPrice to set
	 */
	public void setUnitPrice(BigDecimal unitPrice) {
		this.unitPrice = unitPrice;
	}

	/**
	 * @return the realReturnPrice
	 */
	public BigDecimal getRealReturnPrice() {
		return realReturnPrice;
	}

	/**
	 * @param realReturnPrice the realReturnPrice to set
	 */
	public void setRealReturnPrice(BigDecimal realReturnPrice) {
		this.realReturnPrice = realReturnPrice;
	}

	/**
	 * @return the returnPrice
	 */
	public BigDecimal getReturnPrice() {
		return returnPrice;
	}

	/**
	 * @param returnPrice the returnPrice to set
	 */
	public void setReturnPrice(BigDecimal returnPrice) {
		this.returnPrice = returnPrice;
	}

	/**
	 * @return the isAddOnMaster
	 */
	public Boolean getIsAddOnMaster() {
		return isAddOnMaster;
	}

	/**
	 * @param isAddOnMaster the isAddOnMaster to set
	 */
	public void setIsAddOnMaster(Boolean isAddOnMaster) {
		this.isAddOnMaster = isAddOnMaster;
	}

	public Long getServiceDetailId() {
		return serviceDetailId;
	}

	public void setServiceDetailId(Long serviceDetailId) {
		this.serviceDetailId = serviceDetailId;
	}

	public String getServiceId() {
		return serviceId;
	}

	public void setServiceId(String serviceId) {
		this.serviceId = serviceId;
	}

	public int getProdSeq() {
		return prodSeq;
	}

	public void setProdSeq(int prodSeq) {
		this.prodSeq = prodSeq;
	}

	public int getDetailSeq() {
		return detailSeq;
	}

	public void setDetailSeq(int detailSeq) {
		this.detailSeq = detailSeq;
	}

	public int getOrgDetailSeq() {
		return orgDetailSeq;
	}

	public void setOrgDetailSeq(int orgDetailSeq) {
		this.orgDetailSeq = orgDetailSeq;
	}

	public String getOrgProdSpecId() {
		return orgProdSpecId;
	}

	public void setOrgProdSpecId(String orgProdSpecId) {
		this.orgProdSpecId = orgProdSpecId;
	}

	public String getOrgProdSpecName() {
		return orgProdSpecName;
	}

	public void setOrgProdSpecName(String orgProdSpecName) {
		this.orgProdSpecName = orgProdSpecName;
	}

	public String getProdId() {
		return prodId;
	}

	public void setProdId(String prodId) {
		this.prodId = prodId;
	}

	public String getProdSpecId() {
		return prodSpecId;
	}

	public void setProdSpecId(String prodSpecId) {
		this.prodSpecId = prodSpecId;
	}

	public String getProdName() {
		return prodName;
	}

	public void setProdName(String prodName) {
		this.prodName = prodName;
	}

	public String getProdSpecName() {
		return prodSpecName;
	}

	public void setProdSpecName(String prodSpecName) {
		this.prodSpecName = prodSpecName;
	}

	public String getDetailTp() {
		return detailTp;
	}

	public void setDetailTp(String detailTp) {
		this.detailTp = detailTp;
	}

	public BigDecimal getEcCost() {
		return ecCost;
	}

	public void setEcCost(BigDecimal ecCost) {
		this.ecCost = ecCost;
	}

	public BigDecimal getErpCost() {
		return erpCost;
	}

	public void setErpCost(BigDecimal erpCost) {
		this.erpCost = erpCost;
	}

	public int getQty() {
		return qty;
	}

	public void setQty(int qty) {
		this.qty = qty;
	}

	public String getVendId() {
		return vendId;
	}

	public void setVendId(String vendId) {
		this.vendId = vendId;
	}

	public Long getServiceProdId() {
		return serviceProdId;
	}

	public void setServiceProdId(Long serviceProdId) {
		this.serviceProdId = serviceProdId;
	}

	public Long getOrderDetailId() {
		return orderDetailId;
	}

	public void setOrderDetailId(Long orderDetailId) {
		this.orderDetailId = orderDetailId;
	}

	public String getOrderId() {
		return orderId;
	}

	public void setOrderId(String orderId) {
		this.orderId = orderId;
	}

	public String getShippingOid() {
		return this.shippingOid;
	}

	public void setShippingOid(String shippingOid) {
		this.shippingOid = shippingOid;
	}

	public Long getShippingLineOid() {
		return this.shippingLineOid;
	}

	public void setShippingLineOid(Long shippingLineOid) {
		this.shippingLineOid = shippingLineOid;
	}

	public String getOrgShippingOid() {
		return this.orgShippingOid;
	}

	public void setOrgShippingOid(String orgShippingOid) {
		this.orgShippingOid = orgShippingOid;
	}

	public Long getOrgShippingLineOid() {
		return this.orgShippingLineOid;
	}

	public void setOrgShippingLineOid(Long orgShippingLineOid) {
		this.orgShippingLineOid = orgShippingLineOid;
	}

	public String getCanUseCod() {
		return canUseCod;
	}

	public void setCanUseCod(String canUseCod) {
		this.canUseCod = canUseCod;
	}

	public BigDecimal getUnitVolumeWeight() {
		return unitVolumeWeight;
	}

	public void setUnitVolumeWeight(BigDecimal unitVolumeWeight) {
		this.unitVolumeWeight = unitVolumeWeight;
	}

	public String getReturnRule() {
		return returnRule;
	}

	public void setReturnRule(String returnRule) {
		this.returnRule = returnRule;
	}

	public BigDecimal getGiftcardBalance() {
		return giftcardBalance;
	}

	public void setGiftcardBalance(BigDecimal giftcardBalance) {
		this.giftcardBalance = giftcardBalance;
	}

}
